import Vue from 'vue'
import Vuex from 'vuex'
import { getList } from '../api'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    list: []
  },
  mutations: {
    SET_LIST(state, payload) {
      state.list = payload
    }
  },
  actions: {
    async GET_LIST(context) {
      const resp = await getList()
      context.commit('SET_LIST', resp.data.data)
    }
  },
  modules: {
  }
})
